<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      console.log("" + 1 + 0); // "10"， 字符串连接
      console.log("" - 1 + 0); // -1，进行算术运算，""转换为0，
      console.log(true + false); // 1，进行算术运算，true转换为1，false转换为0
      console.log(6 / "3");// 2,进行算术运算,"3"转化为数字
      console.log("2" * "3");//6 进行算术运算,"2"和"3转化为数字
      console.log(4 + 5 + "px");// 9px 二元算术运算
      console.log("$" + 4 + 5);//$45 第一个为字符串因此进行字符串连接
      console.log("4" - 2);// 2 进行算术运算
      console.log("4px" - 2);//NaN "4px"不是为数字
      console.log("  -9  " + 5);// -9 5  进行字符串连接
      console.log("  -9  " - 5);//-14 进行算术运算
      console.log(null + 1);//1 null值为0
      console.log(undefined + 1);// undefined 值为NaN
      console.log(" \t \n" - 2);// NaN " \t \n"不是数字
      console.log(0 == true);// false 
      console.log(1 == true);//true
      console.log(1 === true);// false 严格不相等 1为number true 为 boolen
      console.log("a" == false);//false 存在字符串
      console.log("" == false);//true
      console.log("" === false);//false
      console.log(undefined == null);//true
      console.log(undefined === null);//false
      console.log(!3);//false
      console.log(!!3);//true
      console.log(123 || null || "abc");//123
      console.log(0 || null || "abc");//abc
      console.log(0 || null || undefined);//undefined
      console.log(123 && null && "abc");//null
      console.log(0 && null && "abc");//0
      console.log(123 && [] && "abc");//abc
      console.log(123 ?? "abc");//123
      console.log(null ?? "abc");//abczz
    </script>
  </body>
</html>
